graphene_rect_init (&bounds,
clip.x - allocation.x, clip.y - allocation.y,
clip.width, clip.height);
- cr = gtk_snapshot_push_cairo_node (snapshot,
- &bounds,
- "Popover");
+ cr = gtk_snapshot_append_cairo_node (snapshot,
+ &bounds,
+ "Popover");
/* Render the rect background */
gtk_render_background (context, cr,
rect_x, rect_y,
if (child)
gtk_container_snapshot_child (GTK_CONTAINER (widget), child, snapshot);
-
- gtk_snapshot_pop (snapshot);
}
static void
return gsk_render_node_get_draw_context (node, snapshot->renderer);
}
-/**
- * gtk_snapshot_push_cairo_node:
- * @snapshot: a #GtkSnapshot
- * @bounds: the bounds for the new node
- * @name: (transfer none): a printf() style format string for the name for the new node
- * @...: arguments to insert into the format string
- *
- * Creates a new render node, appends it to the current render
- * node of @snapshot, and makes it the new current render node.
- *
- * Returns: a cairo_t suitable for drawing the contents of the newly
- * created render node
- *
- * Since: 3.90
- */
-cairo_t *
-gtk_snapshot_push_cairo_node (GtkSnapshot *snapshot,
- const graphene_rect_t *bounds,
- const char *name,
- ...)
-{
- GskRenderNode *node;
-
- g_return_val_if_fail (snapshot != NULL, NULL);
- g_return_val_if_fail (bounds != NULL, NULL);
-
- node = gsk_renderer_create_render_node (snapshot->renderer);
- gsk_render_node_set_bounds (node, bounds);
-
- if (name)
- {
- va_list args;
- char *str;
-
- va_start (args, name);
- str = g_strdup_vprintf (name, args);
- va_end (args);
-
- gsk_render_node_set_name (node, str);
-
- g_free (str);
- }
-
- gtk_snapshot_push_node (snapshot, node);
- gsk_render_node_unref (node);
-
- return gsk_render_node_get_draw_context (node, snapshot->renderer);
-}
-
static void
rectangle_init_from_graphene (cairo_rectangle_int_t *cairo,
const graphene_rect_t *graphene)
void gtk_snapshot_push_node (GtkSnapshot *snapshot,
GskRenderNode *node);
GDK_AVAILABLE_IN_3_90
-cairo_t * gtk_snapshot_push_cairo_node (GtkSnapshot *snapshot,
- const graphene_rect_t *bounds,
- const char *name,
- ...) G_GNUC_PRINTF(3, 4);
-GDK_AVAILABLE_IN_3_90
void gtk_snapshot_pop (GtkSnapshot *snapshot);
GDK_AVAILABLE_IN_3_90